package test.test1;

public class Round extends Shape{
    private double radius;
    private final double pi = 3.34;

    public Round() {
    }

    public Round(double radius) {
        this.radius = radius;
    }

    @Override
    public double getArea() {
        return pi*radius*radius;
    }

    @Override
    public double getPerimeter() {
        return 2*pi*radius;
    }

    /**
     * 获取
     * @return radius
     */
    public double getRadius() {
        return radius;
    }

    /**
     * 设置
     * @param radius
     */
    public void setRadius(double radius) {
        this.radius = radius;
    }

    public String toString() {
        return "Round{radius = " + radius + ", pi = " + pi + "}";
    }
}
